package com.example.entity;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

public class ChatMessage {
    private String content;
    private String userId;
    private String avatar;
    private String name;
    private String timestamp;

    // Constructors, getters and setters
    public ChatMessage() {
    }

    public ChatMessage(String content, String userId, String avatar, String name,String timestamp) {
        this.content = content;
        this.userId = userId;
        this.avatar = avatar;
        this.name = name;
        String dateTime = LocalDateTime.now(ZoneId.of("Asia/Shanghai")).toString();
        this.timestamp=dateTime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }
}
